package com.yunji.base.service;

import com.yunji.base.convert.SiteScaleConvert;
import com.yunji.base.dao.ISiteScaleDao;
import com.yunji.base.domain.SiteScaleDO;
import com.yunji.base.vo.SiteScaleVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SiteScaleService {
    @Resource
    private ISiteScaleDao siteScaleDao;

    public void saveBatch(List<SiteScaleDO> siteScaleList) {
        siteScaleDao.saveBatch(siteScaleList);
    }

    public void deleteBySiteId(Long siteId) {
        siteScaleDao.deleteBySiteId(siteId);
    }

    public void updateBatchById(List<SiteScaleDO> scaleList) {
        siteScaleDao.updateBatchById(scaleList);
    }

    public void setSiteIdByAuditId(Long siteId,Long auditId) {
        siteScaleDao.setSiteIdByAuditId(siteId,auditId);
    }

    public List<SiteScaleVO> selectVOByAuditId(Long auditId) {
        List<SiteScaleDO> list = siteScaleDao.getByAuditId(auditId);
        return SiteScaleConvert.domainTOVOList(list);
    }

    public List<SiteScaleDO> selectByAuditId(Long auditId) {
        return siteScaleDao.getByAuditId(auditId);
    }

    public List<SiteScaleDO> listBySiteId(Long siteId) {
        return siteScaleDao.listBySiteId(siteId);
    }

    public void deleteByAuditId(Long auditId) {
        siteScaleDao.deleteByAuditId(auditId);
    }
}
